﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.ServiceModel;
using Microsoft.WindowsAzure.ServiceRuntime;

namespace DDFolderSync
{
      [ServiceBehavior(
        InstanceContextMode = InstanceContextMode.Single,
        ConcurrencyMode = ConcurrencyMode.Multiple,
#if DEBUG
 IncludeExceptionDetailInFaults = true,
#else
        IncludeExceptionDetailInFaults = false,
#endif
 AddressFilterMode = AddressFilterMode.Any)]
    public class FileChangeReceivingService : IFileSync
    {
        // delegate declaration 
          public delegate void FileChangedHandler(object sender, FileChangeEventArgs fs);

        // event declaration 
          public event FileChangedHandler FileChanged; 


        public void FileChangeMessage(FileInformation fileInfo, FileChangeType changeType)
        {
            if (fileInfo != null)
            {

                FileChanged(this, new FileChangeEventArgs() { FileChangeType = changeType, FileInfo = fileInfo });
            }
        }

    

      
    }
}
